﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DCTLib.Common;

namespace DCTAccess.Business.Search
{
    public class SearchController
    {
        public static DataTable GetSearchByFilter(SearchFilter searchCriteria)
        {
            return searchCriteria.GetSearchResult();
        }

        public static Search GetDataByServices(Search services)
        {
            SearchFilter filter = new SearchFilter();
            filter.Services = services.Services;

            DataTable dt = filter.GetSearchResult();
            if (ValidationHelper.HasRow(dt))
            {
                return new Search(dt.Rows[0]);
            }
            else
            {
                return null;
            }
        }
    }
}
